(function (window, $, undefined) {
  'use strict';



  var evaluateData = {};


  main(function () {
    var $tableComment = $('#table-comment');
    util.jqGrid($tableComment, {
      url: ajaxURL.COUPON + '/comment/queryCommentWithPage',
      datatype: 'json',
      autowidth: true,
      height: $(window).height() - 350,
      multiselect: true,
      multiboxonly: true,
      shrinkToFit: false,
      colModel: [
        { label: '订单编号', key: true, name: 'kid', width: 80 },
        {
          label: '创建时间', name: 'evaluateTime', width: 100, formatter: function (v, o, r) {
            return util.getDate(v)
          }
        },
        { label: '城市', name: '', width: 60 },
        { label: '服务类型', name: '', width: 80 },
        { label: '下单人', name: '', width: 80 },
        {
          label: '用车人', name: '', width: 80
        },
        { label: '车牌号', name: '', width: 100 },
        { label: '司机ID', name: 'driverId', width: 100 },
        { label: '司机号码', name: '', width: 80 },
        { label: '评星', name: 'driverScore', width: 150 }
      ],
      loadComplete: function (res) {
        evaluateData = {};
        if (res && res.data) {
          $.each(res.data, function (_, item) {
            evaluateData[item.kid] = item;
          });
        }
      },
      pager: '#pager-origin'
    })

    laydate.render({
      range: '至',
      elem: '#register-time',
      done: function (value, date, endDate) {
        console.log(value, date, endDate);
        var temp = value.split('至');
        $('#register-time').next().val($.trim(temp[0])).next().val($.trim(temp[1]));
      }
    });

  });
})(window, jQuery);
